<?php

class qccl {
	var $md_plist = '<table id="gdplist">
	<tr>
	<th>编号</th>
	<th>联系电话</th>
	<th>通话序号</th>
	<th>是否释放</th>
	<th>对象名字</th>
	<th>对象组别</th>
	<th>对象组长</th>
	<th>监听人员</th>
	<th>录音生成时间</th>
	<th>监听处理时间</th>
	<th>基本评价</th>
	<th>操作</th>
	</tr>';
	var $show_plist= '';
	var $now_root = 0;
	function chekqclb($st,$et,$lxnumber) { //按时间范围查激活卡表
		global $db;
		global $MEMBER;
		global $now_user;
		global $ajax;
		global $returnajaxcontent;
		// 只返回列表内容，用ajax反馈的方式显示改变网页
		$ajax = true;
		$sql='';
		$this->show_plist = '';
		$this->now_root = $MEMBER->getroot($now_user);
		$i = 0;
		$showplist = $this->md_plist;
		if ($lxnumber!='') {
			$sql = $db->ExeQuerySql("SELECT * FROM `cu_qcxq` WHERE  checknumber='$lxnumber'");
		}else {
			$sql = $db->ExeQuerySql("SELECT * FROM `cu_qcxq` WHERE rectime>='$st' AND rectime<='$et'");
		}
	
		for ($i = 0; $i < $db->db->row_count; $i++) {
			$row = $db->GetFetchArray();
			
				$showplist=$showplist.'<tr><td>'.$i.'</td><td>'.$row['checknumber'].'</td><td>'.$row['sn'].'</td><td>'.$row['release'].'</td><td>'.$row['hwyname'].'</td><td>'.$row['groupname'].'</td><td>'.$row['headman'].'</td><td>'.$row['clname'].'</td><td>'.$row['rectime'].'</td><td>'.$row['cltime'].'</td><td>'.$row['baseappraise'].'</td><td><a href="'.$row['link'].'" target="_new" class="gdhref">快速连接</a>|<a href="temp/plu-in/viewqcxq.php?cn='.$row['checknumber'].'&sn='.$row['sn'].'" target="_new" class="gdhref">详情</a></td></tr>';
			
		}
		$this->show_plist=$showplist.'</table>';
		$returnajaxcontent=$this->show_plist;
	}
	function getchangebutton($cn,$time){
		$m_button='';
		$m_clb='<a href="temp/plu-in/viewgdxq.php?action=progress&cn='.$cn.'&time='.$time.'" target="_new" class="gdhref">处理</a>';
		$m_sc='<a href="temp/plu-in/viewgdxq.php?action=delete&cn='.$cn.'&time='.$time.'"  class="gdhref">删除</a>';
		switch ($this->now_root){
			case 1:
				$m_button = '';
				break;
			case 2:
				$m_button = $m_clb;
				break;
			case 3:
				$m_button = $m_clb;
				break;
			case 4:
				$m_button = $m_clb.' | '.$m_sc;
				break;
			case 5:
				$m_button = $m_clb.' | '.$m_sc;
				break;
		}
		return $m_button;
	}
	function submitLIT($posti){
		global $db;
		global $MEMBER;
		global $now_user;
		$now_em = $MEMBER->getnickname($now_user);
		$appraise='';
		$isop='否';
		$isplan='否';
		$isrepay='否';
		$iscommunicate='否';
		$groupname='';
		$headman='';
		$hwyname='';
		if ($posti){
			if(isset($posti['isop'])==true){
				if($posti['isop']==1){$isop='是';};
			}
			if(isset($posti['isplan'])==true){
				if($posti['isplan']==2){
					$isplan='是';
				};
			}
			if(isset($posti['isrepay'])==true){
				if($posti['isrepay']==3){
					$isrepay='是';
				};
			}
			if(isset($posti['iscommunicate'])==true){
				if($posti['iscommunicate']==4){
					$iscommunicate='是';
				};
			}
			if($posti['groupname']!=NULL){$groupname=$posti['groupname'];};
			if($posti['headman']!=NULL){$headman=$posti['headman'];};
			if($posti['hwyname']!=NULL){$hwyname=$posti['hwyname'];};
			$appraise='总评：'.$posti['fa'].'建议：'.$posti['fb'];
			$sql = "insert into cu_qcxq(checknumber,sn,hwyid,hwyname,groupname,headman,isop,optext,isplan,plantext,isrepay,repaytext,iscommunicate,communicatetext,type,appraise,rectime,cltime,link,baseappraise,clname) values ('$posti[checknumber]','$posti[sn]','$posti[hwyid]','$hwyname','$groupname','$headman','$isop','$posti[optext]','$isplan','$posti[plantext]','$isrepay','$posti[repaytext]','$iscommunicate','$posti[communicatetext]','$posti[qclb]','$appraise',now(),now(),'$posti[link]','$posti[qcpjlb]','$now_em')";
		}
		$db->ExeSql($sql);
		$db->ExeQuerySql("select * from cu_qcxq where checknumber='$posti[checknumber]' and sn='$posti[sn]'");
		if($db->FetchRow())
		{
			echo "<script>alert('操作成功!');</script>";
		}else{
			echo "<script>alert('操作不成功!');</script>";
		}
	}

}

?>